﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Blader.Config;
using Blader.Entity;

namespace Blader.UI.Forms
{
    public partial class SettingForm : Form
    {
        public SettingForm()
        {
            InitializeComponent();
        }

        private void SettingForm_Load(object sender, EventArgs e)
        {
            ProjectWebBrowser.ObjectForScripting = this;


            ProjectWebBrowser.DocumentText = BuildProjectHtml();
        }

        public string BuildProjectHtml()
        {
            List<ProjectItem> projectItems = ConfigReader.GetInstance().LoadProjects();
            return NvEngine.GetInstance().Process(Resource.ProjectTemplate, new Dictionary<string, object>()
                                                                         {
                                                                             { "ProjectItems", projectItems }
                                                                         });
        }

        public void DeleteProject(String message)
        {
            MessageBox.Show(message, message);
        }

    }
}
